﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Diagnostics;
using CocosDenshion;
using cocos2d;

namespace Meteorite
{

    public class Speedup : Object
    {

        public Speedup(Model model)
            :base(model)
        {
            Scale = 2.0f;
        }

        public override void CollideWithShip(Ship ship)
        {
            if (Meteorite.ship.CanEatSomething())
            {
                Valid = false;
                ship.SpeedUp();
                if (0 == UserData.Instance().GetValue(GameConstant.UserData_Sound))
                {
                    SimpleAudioEngine.sharedEngine().playEffect(CCFileUtils.fullPathFromRelativePath(GameConstant.Sound_SpeedBonus));
                }
                UserData.Instance().AddValue(GameConstant.UserData_GetBoost, 1);
                UserData.Instance().AddValue(GameConstant.UserData_TotalBounus, 1);

            }
        }
    }
}

